<template>
  <div class="user_login">
    <div class="login_input">
      <div style="margin-bottom: 8px">
        <el-select v-model="data.formData.group_id" placeholder="分组" style="width: 100%">
          <el-option
            v-for="item in state.groupList"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          />
        </el-select>
      </div>
      <div class="user_pass">
        <el-input v-model="data.formData.user_name" style="width: 126px; height: 28px" placeholder="账号" />
        <el-input
          v-model="data.formData.pass_word"
          style="width: 126px; height: 28px; margin-left: 8px"
          placeholder="密码"
        />
      </div>
      <div>
        <app-ip-input :data="data.formData" />
      </div>
    </div>
    <div class="login_button">
      <el-button class="button" v-if="data.isLogin == 0" @click="store.clicklogin(data)">登录</el-button>
      <el-button class="button button2" disabled v-if="data.isLogin == 2">登录中</el-button>
    </div>
  </div>
</template>

<script setup>
const props = defineProps({
  data: Object,
})
const { store, state } = inject('Home')
</script>

<style lang="scss" scoped>
.user_login {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.login_input {
  display: flex;
  flex-direction: column;
}

.user_pass {
  display: flex;
  margin-bottom: 8px;
}
.button,
.button:hover {
  width: 52px;
  height: 28px;
  background-color: var(--pcmain-color);
  border-color: var(--pcmain-color);
  border-radius: 0;
  font-size: 14px;
  color: #fff;
}

.button2 {
  opacity: 0.6;
  font-size: 12px;
}
</style>

<style>
.user_pass .el-input__wrapper {
  border-radius: 0;
}
</style>